package com.sunyard.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhix.huang
 * @ClassName StatusConstant
 * @Package com.sunyard.constant
 * @Description 状态常量
 * @Date 2018/11/8 20:03
 * @Version V1.0
 */
public class StatusConstant {
    public static final String SUCCESS = "SUCCESS";        //成功
    public static final String FAILL = "FAILL";            //失败
    public static final String WX_USERPAYING = "USERPAYING";  //正在使用
    public static final String WX_PAYERROR = "PAYERROR";    //支付失败

    /**
     * 订单状态（两位数字）：
     * 00  交易初始
     * 01	交易支付中
     * 02	交易成功
     * 03	交易失败
     * 04	交易关闭
     * 05	已撤销
     * <p>
     * 10	已退款
     * 11	退款中
     * 12	退款异常
     * 13	退款关闭
     */
    //交易初始化
    public static final String PAY_INIT = "00";
    //交易正在进行
    public static final String PAY_USEPAYING = "01";

    //public static final String PAY_WAIT = "02";

    //交易成功
    public static final String PAY_SUCCESS = "02";
    //交易失败
    public static final String PAY_FAIL = "03";
    //交易关闭
    public static final String PAY_CLOSE = "04";
    //订单撤销
    public static final String PAY_REVOKED = "05";

    //退款
    public static final String PAY_REFUND = "10";
    //退款中
    public static final String PAY_REFUNDING = "11";
    //退款错误
    public static final String PAY_REFUND_ERROR = "12";
    //退款关闭
    public static final String PAY_REFUND_CLOSE = "13";


    //二维码终端
    public static final String DEVICE_QRCODE = "1";
    //智能pos
    public static final String DEVICE_SMART = "0";
    //手机银行
    public static final String DEVICE_MOBILE_BANK = "3";
    //静态码
    public static final String DEVICE_MOBILE_SATIC_QRCODE = "4";
    //网上银行
    public static final String DEVICE_INTERNET_BANK = "5";
    //收银宝
    public static final String SYB = "6";


    //被扫
    public static final String PASSIVE = "1001";
    //主扫
    public static final String CHOOSECHANNEL = "1002";
    //静态二维码
    public static final String STATICQR = "1004";
    //动态二维码生成
    public static final String DYNAMICQR = "1003";
    //查询订单状态
    public static final String QUERYORDERSTATE = "1005";
    //退款
    public static final String REFUND = "1006";
    //查看退款
    public static final String QUERYREFUND = "1007";
    //撤销订单
    public static final String REVOKEORDER = "1008";
    //关闭订单
    public static final String CLOSEORDER = "1009";
    //交易流水查询
    public static final String TRANSFLOWQUERY = "1010";
    //交易流水查询
    public static final String APP_PAY = "1011";


    //respCode
    public static final String UNION_RESPCODE = "respCode";
    //respMsg
    public static final String UNION_RESPMSG = "respMsg";
    //成功
    public static final String UNION_RESPCODE_SUCCESS = "00";
    //未知
    public static final String UNION_RESPCODE_UNKNOW = "04";


    //二维码正常
    public static final String QRCODE_STATUS_NORMAL = "1";
    //二维码超时
    public static final String QRCODE_STATUS_TIMEOUT = "2";
    //二维码关闭
    public static final String QRCODE_STATUS_STOP = "3";
    //二维码已经在使用中
    public static final String QRCODE_STATUS_ISUSED = "4";

    //动态码
    public static final String QRCODE_TYPE_DYN = "0";
    //静态码
    public static final String QRCODE_TYPE_STATIC = "1";

    /**
     * 是否为小微商户 1-是  2-否
     */
    public static final String SMALL_MERCHANT = "1";
    /**
     * 是否为小微商户 1-是  2-否
     */
    public static final String NO_SMALL_MERCHANT = "2";


    /**
     * 审核类型0 -添加(终端厂商) 1 -删除(终端厂商) 2 -修改(终端厂商) 3-选择终端(终端组管理下)
     * [终端表]0-单个添加终端 1-批量添加终端 2-删除终端
     */
    public static final Integer AUDIT_TYPE_ADD = 0;
    public static final Integer AUDIT_TYPE_BATCH_ADD = 1;
    public static final Integer AUDIT_TYPE_DELETE = 1;
    public static final Integer AUDIT_TYPE_DELETE_DEVICE = 2;
    public static final Integer AUDIT_TYPE_UPDATE_DEVICE = 3;
    public static final Integer AUDIT_TYPE_UPDATE = 2;
    public static final Integer AUDIT_TYPE_SELECT = 3;
    /**
     * 审核状态0 -未审核 1 -审核通过 2 -审核未通过
     */
    public static final Integer AUDIT_FLAG_DEFAULT = 0;
    public static final Integer AUDIT_FLAG_PASS = 1;
    public static final Integer AUDIT_FLAG_FAIL = 2;

    /**
     * 复核状态0 -未复核 1 -复核通过 2 -复核未通过
     */
    public static final Integer CHECK_FLAG_DEFAULT = 0;
    public static final Integer CHECK_FLAG_PASS = 1;
    public static final Integer CHECK_FLAG_FAIL = 2;

    /**
     * 用户审核类型  审核类型0 -添加用户 1 -删除用户 2 -修改用户 3 -重置密码 4 -登入解锁
     * 5 -用户启用 6 -用户停用
     */
    public static final Integer AUDIT_TYPE_RESETPWD = 3;
    public static final Integer AUDIT_TYPE_UNLOCK = 4;
    public static final Integer AUDIT_TYPE_ENABLE = 5;
    public static final Integer AUDIT_TYPE_DISABLE = 6;

    public static final Integer AUDIT_TYPE_ROLECONFIGPOPEDOM = 3;
    public static final Integer AUDIT_TYPE_ORGCONFIGPOPEDOM = 3;

    /**
     * 商户绑定终端审核操作0 -添加 1-修改 2-启用 3-停用 4-注销 5-绑定终端 6-解绑终端
     */
    public static final Integer AUDIT_MCHNT_DEVICE_ADD = 0;
    public static final Integer AUDIT_MCHNT_DEVICE_UPDATE = 1;
    public static final Integer AUDIT_MCHNT_DEVICE_ENABLE = 2;
    public static final Integer AUDIT_MCHNT_DEVICE_DISABLE = 3;
    public static final Integer AUDIT_MCHNT_DEVICE_LOGOUT = 4;
    public static final Integer AUDIT_MCHNT_DEVICE_BIND = 5;
    public static final Integer AUDIT_MCHNT_DEVICE_DISBIND = 6;

    /**
     * 机具分拨审核操作 0-机具分拨
     */
    public static final String AUDIT_DEVICE_DISPATCH = "0";


    /**
     * 审核类型
     * 1-新增
     * 2-修改
     * 3-注销
     * 4-启用
     * 5-停用
     * 6-T0申请
     * 7-pos、码牌费率限额分离申请
     * 8-微信商户名称修改
     * 8  9启停用银联收单
     */
    public static final int MANAGE_AUDIT_TYPE_ADD = 1;
    public static final String MANAGE_TYPE_ADD = "1";
    public static final int MANAGE_AUDIT_TYPE_UPDATE = 2;
    public static final String MANAGE_TYPE_UPDATE = "2";
    public static final int MANAGE_AUDIT_TYPE_DELETE = 3;
    public static final String MANAGE_TYPE_DELETE = "3";
    public static final int MANAGE_AUDIT_TYPE_ENABLE = 4;
    public static final String MANAGE_TYPE_ENABLE = "4";
    public static final int MANAGE_AUDIT_TYPE_DISABLE = 5;
    public static final String MANAGE_TYPE_DISABLE = "5";
    public static final int MANAGE_AUDIT_TYPE_T0 = 6;
    public static final String MANAGE_TYPE_T0 = "6";
    public static final int MANAGE_AUDIT_TYPE_RESOLVE = 7;
    public static final String MANAGE_TYPE_RESOLVE = "7";

    public static final int MANAGE_AUDIT_TYPE_DISABLEUP = 9;//停用银联收单
    public static final String MANAGE_TYPE_DISABLEUP = "9";
    public static final int MANAGE_AUDIT_TYPE_WXUPDATE = 8;
    public static final String MANAGE_TYPE_WXUPDATE = "8";

    /**
     * status 状态
     * 1--启用
     * 2--停用
     * 3--注销
     */
    public static final String MANAGE_STATUS_OPEN = "1";
    public static final String MANAGE_STATUS_CLOSE = "2";
    public static final String MANAGE_STATUS_DELETE = "3";

    /**
     * 审核状态0 -未审核 1 -审核通过 2 -审核未通过
     */
    public static final int MANAGE_AUDIT_FLAG_DEFAULT = 0;
    public static final int MANAGE_AUDIT_FLAG_PASS = 1;
    public static final int MANAGE_AUDIT_FLAG_FAIL = 2;
    public static final String MANAGE_FLAG_DEFAULT = "0";
    public static final String MANAGE_FLAG_PASS = "1";
    public static final String MANAGE_FLAG_FAIL = "2";

    /**
     * 复核状态0 -未复核 1 -复核通过 2 -复核未通过
     */
    public static final int MANAGE_CHECK_FLAG_DEFAULT = 0;
    public static final int MANAGE_CHECK_FLAG_PASS = 1;
    public static final int MANAGE_CHECK_FLAG_FAIL = 2;

    /**
     * 秘钥下发状态 0-未绑定 1-公钥下发 2-主秘钥下发 3-绑定成功 4-绑定失败
     */
    public static final String KEY_STATUS_DEFAULE = "0";
    public static final String KEY_STATUS_PUBLIC = "1";
    public static final String KEY_STATUS_MAIN = "2";
    public static final String KEY_STATUS_SUCCESS = "3";
    public static final String KEY_STATUS_FAIL = "4";


    /**
     * 巡检任务状态    0-待分配 1-待接单 2-已接单 3-已改派 4-已完成 5-已过期 6-已删除
     */
    public static final String INSPECT_STATUS_ASSIGN = "0";
    public static final String INSPECT_STATUS_AWAIT = "1";
    public static final String INSPECT_STATUS_ACCEPT = "2";
    public static final String INSPECT_STATUS_CHANGE = "3";
    public static final String INSPECT_STATUS_SUCCESS = "4";
    public static final String INSPECT_STATUS_OUTTIME = "5";
    public static final String INSPECT_STATUS_DELETE = "6";

    /**
     * 巡检原因：0-证件到期 1-定期巡检 2-存在风险 3-商户信息修改 4-商户三个月未交易即将停用 5-新商户15天巡检 6-新商户一年巡检
     */
    public static final String INSPECT_REASON_TIMEOUT = "0";
    public static final String INSPECT_REASON_TIME = "1";
    public static final String INSPECT_REASON_RISK = "2";
    public static final String INSPECT_REASON_MERCHANT = "3";
    public static final String INSPECT_REASON_THREEMONTH = "4";
    public static final String INSPECT_REASON_FIFTEEN = "5";
    public static final String INSPECT_REASON_YEAR = "6";


    /**
     * 巡检任务来源 0-手工创建 1-系统生成 2-改派
     */
    public static final String INSPECT_SOURCE_HAND = "0";
    public static final String INSPECT_SOURCE_AUTO = "1";
    public static final String INSPECT_SOURCE_CHANGE = "2";

    /**
     * 巡检任务是否过期 0-否 1-是
     */
    public static final String INSPECT_IS_EXPIRE = "1";
    public static final String INSPECT_NOT_EXPIRE = "0";

    /**
     * 商户规定时间内未交易，85号文进行停用
     */
    public static final String STOP_ONE_YEAR = "85号文，105-365天未进行交易，商户停用";
    public static final String STOP_OVER_YEAR = "85号文，超过一年未进行交易，商户停用";

    /**
     * 是否包含子机构 0-不包含 1-包含
     */
    public static final String INCLUDE_SUB_ORG_IS = "1";
    public static final String INCLUDE_SUB_ORG_NOT = "0";

    /**
     * 启用风控状态  0-未启用    1 -启用
     */
    public static final String MANAGE_RISK_NO = "0";
    public static final String MANAGE_RISK_ENABLE = "1";

    public static Map<String, Integer> map = null;

    static {
        // "%-01s%-2s%-4s%-40s%-8s%-30s%-28s%-122s%-1s%-15s%-1s%-1s%-4s%-16s%-13s%-1s%-32s%-1s%-1s%-2s%-5s%-8s%-15s%-28s%-122s%-1s%-15s%-1s%-1s%-4s%-16s%-13s%-1s%-32s%-1s%-1s%-2s%-5s%-8s%-15s%-28s%-15s%-1s%-8s%-14s%-4s%-28s%-15s%-1s%-8s%-14s%-4s%-28s%-15s%-1s%-8s%-14s%-4s%-28s%-15s%-1s%-8s%-14s%-4s"
        // 生成划款文件长度
        map = new HashMap<>();
        map.put("data1", 1);
        map.put("data2", 2);
        map.put("zydm", 4);
        map.put("smt", 40);
        map.put("workDate", 8);
        map.put("seqNo", 30);
        map.put("payeeacc", 28);
        map.put("payname1", 122);
        map.put("data3", 1);
        map.put("amount", 15);
        map.put("c", 1);
        map.put("ch1", 1);
        map.put("voutype1", 4);
        map.put("vouchno", 16);
        map.put("czysh1", 13);
        map.put("xekzbz1", 1);
        map.put("chetype", 32);
        map.put("zfgnh1", 1);
        map.put("jzflx1", 1);
        map.put("zflx1", 2);
        map.put("zfxh1", 5);
        map.put("zfrq1", 8);
        map.put("zfamount1", 15);
        map.put("kfzh2", 28);
        map.put("kfmc2", 122);
        map.put("jylx2", 1);
        map.put("khamount", 15);
        map.put("khdcflag2", 1);
        map.put("ch2", 1);
        map.put("voutype2", 4);
        map.put("vouno2", 16);
        map.put("czysh2", 13);
        map.put("xekzbz", 1);
        map.put("chetype2", 32);
        map.put("zfgnh2", 1);
        map.put("jzflx2", 1);
        map.put("zflx2", 2);
        map.put("zfxh2", 5);
        map.put("zfrq2", 8);
        map.put("zfamount2", 15);
        map.put("payeracc", 28);
        map.put("inamount", 15);
        map.put("d", 1);
        map.put("xzdqr1", 8);
        map.put("xzbh1", 14);
        map.put("xjxmh1", 4);
        map.put("feeadvanpayeraccno", 28);
        map.put("feeadvanpayeramount", 15);
        map.put("feedcflag", 1);
        map.put("xzdqr2", 8);
        map.put("xzbh2", 14);
        map.put("xjxmh2", 4);
        map.put("nbzh3", 28);
        map.put("amount3", 15);
        map.put("dcflag3", 1);
        map.put("xzdqr3", 8);
        map.put("xzbh3", 14);
        map.put("xjxmh3", 4);
        map.put("nbzh4", 28);
        map.put("amount4", 15);
        map.put("dcflag4", 1);
        map.put("xzdqr4", 8);
        map.put("xzbh4", 14);
        map.put("xjxmh4", 4);
    }

    public static void main(String[] args) {
        Integer value = 0;
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            value = value + entry.getValue();
        }
        System.out.println(value);
    }

    // 上传文件接口
    public static final String SERVICE_ID_UPLOAD_STATUS = "04010000008501";
    // esb 文件状态
    public static final String SERVICE_ID_ESB_STATUS = "04010000008503";
    // 核心状态
    public static final String SERVICE_ID_CORE_STATUS = "00010000008503";
    // 下载文件受理
    public static final String SERVICE_ID_DOWNLOAD_ACCEPT_STATUS = "04010000008601";
    // 下载文件完成
    public static final String SERVICE_ID_DOWNLOAD_COMPLETE_STATUS = "04010000008602";
    // 申请下载T0文件
    public static final String SERVICE_ID_DOWNLOAD_CORE_FILE = "00010000807001";
    // 下载卡文件
    public static final String SERVICE_ID_DOWNLOAD_CARD_FILE = "32210000000013";
    // 综合收单交易码
    public static final String SERVICE_ID_DOWNLOAD_CARD_TRANCODE = "2060";
    // 生成前一天的对账文件：-1生成失败，0正在生成，1生成成功
    public static final String SERVICE_ID_CREATE_TRANSFER_FILE = "create-file";

    // esb返回code
    public static final String CODE_SUCCESS = "S000A000";

    // ods返回code
    public static final String ODS_SUCCESS = "000000";

    // esb返回失败
    public static final String CODE_FAIL_EH601 = "EH601";
    // esb返回status失败
    public static final String STATUS_FAIL = "FAIL";

    // 划款异常
    public static final String TRANSFER_STATUS_ERROR = "99";

    // 划款成功（批文件）
    public static final String TRANSFER_STATUS_SUCCESS = "2";

    // T0标志
    public static final String FLAG_T0 = "1";

    // T1标志
    public static final String FLAG_T1 = "0";

    // 划款成功（联机交易)
    public static final String TRANSFER_SUCCESS = "1";
    // 划款失败(联机交易)
    public static final String TRANSFER_FAIL = "2";

    // 挂账成功
    public static final String OA_ACCOUNT_SUCCESS = "4";
    // 挂账失败
    public static final String OA_ACCOUNT_FAIL = "6";
    // 挂账超时
    public static final String OA_ACCOUNT_TIMEOUT = "7";

    // 省联社清算等级
    public static final String ORG_SLS = "320099900";
    // 省联社管理机构
    public static final String ORG_GL_SLS_ = "320099999";

    // 数据库实例名称
    public static final String ZHSDW1 = "zhsdw1";
    public static final String ZHSDW2 = "zhsdw2";
    public static final String ZHSDW3 = "zhsdw3";

    // T0记账状态
    /**
     * 记账成功
     */
    public static final String T0_FUNDS_OUT_SUCCESS = "1";
    /**
     * 记账失败
     */
    public static final String T0_FUNDS_OUT_FAIL = "0";

    // 入账状态
    public static final String TRANSFERED_NO = "0"; // 未入账
    public static final String TRANSFERED_YES = "1";// 已入账
    public static final String TRANSFERED_GZ_SUCCESS = "4"; // 已挂账
    public static final String TRANSFERED_GZ_FAIL = "6"; // 挂账失败;
    public static final String TRANSFERED_GZ_TIMEOUT = "7"; // 挂账超时
    public static final String TRANSFERED_PART_YES = "8"; // 部分入账成功
    public static final String TRANSFERED_FAIL = "9"; // 入账失败


    /**
     * 差错账开关
     */
    public static final String RECON_ERR_DEAL_SWITCH = "RECON_ERR_DEAL_SWITCH";

    /**
     * 商户划款开关
     */
    public static final String RECON_TRANSFER_SWITCH = "RECON_TRANSFER_SWITCH";

    /**
     * 终端绑定开关
     */
    public static final String DEVICE_BIND_SWITCH = "DEVICE_BIND_SWITCH";

    /**
     * 存量跑批开关
     */
    public static final String EXIST_RASK_SWITCH = "EXIST_RASK_SWITCH";

    /**
     * 对账开关
     */
    public static final String RECON_SWITCH_OPEN = "1";
    public static final String RECON_SWITCH_CLOSE = "2";

    /**
     * 微信支付宝对接商户端设备类型
     * 06-云闪付
     * 04-智能pos
     * 08-手机银行
     * 11-辅助受理终端
     */
    public static final String WX_DEVICE_QRCODE = "06";
    public static final String WX_DEVICE_SMART = "04";
    public static final String WX_DEVICE_MOBILE_BANK = "08";
    public static final String WX_DEVICE_HELP = "11";


    /**
     * 设备状态
     * 0-启用
     * 1-停用
     * 2-注销
     * 3-回收
     */
    public static final String DEVICE_ENABLE = "0";
    public static final String DEVICE_DISENABLE = "1";
    public static final String DEVICE_LOGOUT = "2";
    public static final String DEVICE_RECOVER = "3";

    /**
     * 微信支付宝对接商户端设备状态
     * 00-启用
     * 01-注销
     */
    public static final String WX_DEVICE_ENABLE = "00";
    public static final String WX_DEVICE_DISENABLE = "01";

    /**
     * 微信支付宝 是否存量商户
     * 00 是
     * 01 否
     */
    public static final String IS_EXIST = "00";
    public static final String NOT_EXIST = "01";


}
